package cn.edu.sjtu.se.dslab.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.edu.sjtu.se.dslab.component.data.DomainEntity;
import cn.edu.sjtu.se.dslab.component.method.MethodToDomain;
import cn.edu.sjtu.se.dslab.dao.IMethodToDomainDao;
import cn.edu.sjtu.se.dslab.service.IMethodToDomainService;
@Service("methodToDomainService")
@Transactional
public class MethodToDomainServiceImpl implements IMethodToDomainService {

	@Resource(name="methodToDomainDao")
	IMethodToDomainDao methodToDomainDao;
	
	
	@Override
	public boolean addMethodToDomain(MethodToDomain methodToDomain) {
		// TODO Auto-generated method stub
		methodToDomainDao.save(methodToDomain);
		return true;
	}

	@Override
	public boolean updateMethodToDomain(MethodToDomain methodToDomain) {
		// TODO Auto-generated method stub
		methodToDomainDao.update(methodToDomain);
		return true;
	}

	@Override
	public MethodToDomain getMethodToDomainById(long id) {
		// TODO Auto-generated method stub
		return methodToDomainDao.queryById(id);
		
	}

	@Override
	public List<MethodToDomain> getMethodToDomainByDomainEntity(
			DomainEntity entity) {
		// TODO Auto-generated method stub
		return methodToDomainDao.queryByDomainEntity(entity);
	}

}
